package io.scnb.lesson001.demo26.test7;

import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class Service2 {
    
    @Resource
    private Service1 service1;  // 字段名称为service1，则按照字段名称在容器中查找bean，会找到Service1

    @Override
    public String toString() {
        return "Service2{" +
                "service1=" + service1 +
                '}';
    }
}
